# -*- coding: utf-8 -*-
# author: sixmillions
# date: 2022/04/08

"""
selenium设置代理
先安装：conda install selenium
https://www.cnblogs.com/yuxuanlian/p/10139659.html
"""
import time

from selenium import webdriver

driver_path = r'D:\OpenSources\chromedriver_win32\chromedriver.exe'

proxy = '123.58.10.36:8080'
# proxy='username:password@123.58.10.36:8080'
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--proxy-server=http://' + proxy)
browser = webdriver.Chrome(executable_path=driver_path, chrome_options=chrome_options)
browser.get('http://httpbin.org/get')

time.sleep(10)
browser.close()
